﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Template</title>
    <script src="~/Scripts/jquery-1.8.2.min.js"></script>
</head>
<body style="background-color:#f1ebeb">
    <div id="AlertInfo" class="container" style="width:1000px;position:absolute;margin-left:13%;margin-top:50px;font-weight:bolder">

    </div>
    <div id="NormalPage">
        @RenderBody()
    </div>
</body>
</html>
<script>
    $(function () {
        LoadPage();
        LoadEducation();
        LoadPolitical();
    })
    //加载页面，母版页
    function LoadPage() {
        $.ajax({
            type: "post",
            url: "/Employee/ShowBasicInfo",
            success: function (obj) {
                if (obj == -1) {
                    location.href = '/Employee/CompleteInfo';
                }
                switch (obj) {
                    case "0":
                        $("#AlertInfo").hide();
                        $("#NormalPage").show();
                        break;
                    case "-1":
                        location.href = '/Employee/CompleteInfo';
                        break;
                    case "1":
                        $("#NormalPage").hide();
                        $("#AlertInfo").show();
                        $("#AlertInfo").html("<h2>正在审核中，请稍等。。。</h2>")
                        break;
                    case "2":
                        $("#NormalPage").hide();
                        $("#AlertInfo").show();
                        $("#AlertInfo").html("<h2>信息核对失败，请重新提交。<a href='/Employee/CompleteInfo'>点击进入</a></h2>")
                        break;
                    default:
                        location.href = '/Employee/Login';
                }
            }
        })
    }

    //加载学历
    function LoadEducation() {
        $.ajax({
            type: "post",
            url: "/Employee/GetEducationList",
            success: function (obj) {
                obj = JSON.parse(obj);
                var str = "";
                for (var i = 0; i < obj.length; i++) {
                    str += "<option value='" + obj[i].EducationID + "'>" + obj[i].EducationName + "</option>"
                }
                $("#txtEducationID").html("<option value='0'>请选择</option>" + str);
            }
        })
    }

    //加载政治面貌
    function LoadPolitical() {
        $.ajax({
            type: "post",
            url: "/Employee/GetPoliticalList",
            success: function (obj) {
                obj = eval("" + obj + "");
                var str = "";
                for (var i = 0; i < obj.length; i++) {
                    str += "<option value='" + obj[i].PoliticalID + "'>" + obj[i].PoliticalName + "</option>"
                }
                $("#txtPoliticalID").html("<option value='0'>请选择</option>" + str);
            }
        })
    }

</script>